/**********************************************************************************************/
// dgt_BoolFunction.h
//
// Common Lib for Digital Studio
// Block of management of bool functions
// Class of elementary bool function
//
// Copyright Diamant Group 2008
/**********************************************************************************************/
#ifndef _DGT_BOOLFUNCTION_H_
#define _DGT_BOOLFUNCTION_H_

#include "dgtKernel.h"
#include "dgt_SmartMacros.h"
#include "dgt_BoolElement.h"

SMART_CLASS( dgt_BoolFunction );

#include "dgt_BoolConverter.h"

/**********************************************************************************************/
class dgt_BoolFunction
{
	public://///////////////////////////////////////////////////////////////////////////////////

friend	class dgt_BoolConverter;

		/**
		* @brief Ctor as default
		*/
								dgt_BoolFunction();

		/**
		* @brief Dtor as default
		*/
virtual							~dgt_BoolFunction()								{};

		/**
		* @brief Function for getting array of elementary parts of bool functions, 
		*		 thats represent function as a whole
		* @return Bool function
		*/
		BoolElementArray		get_Function( void );							

		/**
		* @brief Function for getting array of variables, 
		* @return Array of variables
		*/
		wxArrayString			get_VarNames( void );

		/**
		* @brief Function for getting kind of normal form of bool function, 
		* @return Kind of normal form
		*/
		NORMAL_KIND				get_Kind( void );	

		/**
		* @return	Index of second operation in boolean function. F. e. if this is a AND/OR form,
		*			it will return index of first operation OR
		*/
		unsigned				get_IndexOfSecondOperation( void );


		/**
		* @brief Operator ==
		* @param lValue Left value
		* @param rValue Right value
		* @return TRUE, if bool functions are equal
		*/
friend	bool					operator==( dgt_BoolFunction_Ptr	lValue,
											dgt_BoolFunction_Ptr	rValue );

		/**
		* @brief Function for setting array of elementary parts of bool functions, 
		*		 thats represent function as a whole
		* @param New bool function
		*/
		void					set_Function( BoolElementArray inFunction );

		/**
		* @brief Function for setting array of variables, 
		* @param New array of variables
		*/
		void					set_VarNames( wxArrayString &inVarNames );

		/**
		* @brief Function for setting kind of normal form of bool function, 
		* @param Kind of normal form
		*/
		void					set_Kind( NORMAL_KIND inKind );

	private:////////////////////////////////////////////////////////////////////////////////////

		wxArrayString			m_VarNames;						/*!< Array of variables of function */

		NORMAL_KIND				m_Kind;							/*!< Kind of normal form of function */

		BoolElementArray		m_BoolFunction;					/*!< Array of elementary parts of bool function */
};

#endif // _DGT_BOOLFUNCTION_H_
